<template>
    <div class="head-right clearfix listBox">
        <div class="block06 float-l ft height">
            <div id="insertion" class="smallB06 clearfix">
                <icon v-for="config in insertion" :config="config" :key="config.text"></icon>
                <table-picker></table-picker>
            </div>
        </div>
    </div>
</template>
<script>
    import Icon from './Icon'
    import TablePicker from './TablePicker'
    import {mapState} from 'vuex'
    import {Observer} from '../../core/util'
    import {MessageBox, Message} from 'element-ui'

    export default {
        components: {
            Icon,
            TablePicker
        },
        computed: {
        },
        methods: {
        },
        created(){

        },
        data() {
            return {
                // 字符、公式、超链接、图片等
                insertion: [
                    {
                        text: $.i18n('toolbar_spechars'),
                        cmd: 'spechars',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_formula'),
                        cmd: 'formula',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_link'),
                        cmd: 'link',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_image'),
                        cmd: 'insertimage',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_table'),
                        cmd: 'addtable',
                        isDialog: true,
                        showText: true,
                        customFn: function () {
                            if (!window.editorId) return Message({
                                message: $.i18n('messager_need_to_focus'),
                                type: 'warning'
                            });
                            Observer.fire('showtablepicker');
                            Observer.fire('showcloth');
                        }
                    },
                    {
                        text: $.i18n('toolbar_video'),
                        cmd: 'insertvideo',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_audio'),
                        cmd: 'insertaudio',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_quote'),
                        cmd: 'insertQuote',
                        //isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_map'),
                        cmd: 'map',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_attach'),
                        cmd: 'attachment',
                        isDialog: true,
                        showText: true
                    },
                    {
                        text: $.i18n('toolbar_pagebreak'),
                        cmd: 'pagebreak',
                        //isDialog: true,
                        showText: true
                    },
                ],
            }
        }
    }
</script>
